package java6681.lesson08;

import java.util.Scanner;

public class NumberString6681 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入字符串:");
        String line = sc.nextLine();
        boolean bool = isNumber6681(line);
        System.out.print(line);
        System.out.println(":全部是" + bool);
    }

    public static boolean isNumber6681(String s) {
        boolean isFlag = true;
        String sb = "";
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c >= '0' && c <= '9' ) {
                    sb += s.charAt(i);
            } else {
                isFlag = false;
            }
        }
        if ( sb.length() == 0){
            isFlag = false;
        }
        return isFlag;
    }
}

